home *** CD-ROM | disk | FTP | other *** search
/ Freelog 51 / Freelog051.iso / Dossier / Simple browser / simpleBrowser.msi / _D82D16C5E4F5BFCBD7413D2074124C56 / _230D00014A744D2095E83E99944BBAB4 < prev    next >
Extensible Markup Language  |  2003-11-21  |  10KB  |  328 lines

  1. <?xml version="1.0" ?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/" xmlns:rss="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rss09="http://my.netscape.com/rdf/simple/0.9/">
  3.  
  4. <xsl:output method="html"  indent="yes"/>
  5. <xsl:template match="/rss/channel">
  6. <html>
  7. <head>
  8. <title><xsl:value-of select="title"/></title>
  9. </head>
  10. <body bgcolor="#0099FF" background="background-rss.jpg" link="#33FF00" vlink="#FFFF99">
  11. <p>
  12. <strong><font size="5" face="Arial, Helvetica, sans-serif"><a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  13. <xsl:value-of select="title"/></a></font></strong>
  14. </p>
  15.  
  16.     <xsl:if test="image">
  17.     <!--
  18.      --> 
  19.         <p><img><xsl:attribute name="src"><xsl:value-of select="image/url"/></xsl:attribute> 
  20.         <xsl:if test="image/width">
  21.             <xsl:attribute name="width"><xsl:value-of select="image/width"/></xsl:attribute> 
  22.         </xsl:if>
  23.         <xsl:if test="image/height">
  24.             <xsl:attribute name="height"><xsl:value-of select="image/height"/></xsl:attribute>
  25.         </xsl:if>
  26.         </img></p>
  27.     </xsl:if>
  28.  
  29.     <xsl:if test="description">
  30.         <strong><font size="4">
  31.         <xsl:value-of select="description"/>
  32.         </font></strong>
  33.     </xsl:if>
  34. <p>
  35.     <xsl:if test="lastBuildDate">
  36.         <strong>Last Modified:  
  37.         <xsl:value-of select="lastBuildDate"/>
  38.         </strong>
  39.     </xsl:if>
  40.     <xsl:if test="pubDate">
  41.         <p></p><strong>    Publication Date:  
  42.         <xsl:value-of select="pubDate"/>
  43.         </strong>
  44.     </xsl:if>
  45. </p>
  46.  
  47. <HR size="6" color="darkblue" />
  48. <p></p>
  49. <table width="100%" border="1">
  50. <dl>
  51. <xsl:for-each select="item">
  52.  <tr> 
  53.     
  54.     <xsl:choose>
  55.     <xsl:when test="position() mod 2 = 1">
  56.       <td bgcolor="#3399FF">
  57.             <strong><font size="4">
  58.          <dt>
  59.             <a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  60.               <xsl:value-of select="title"/>  </a>
  61.     <xsl:if test="author">
  62.             (<xsl:value-of select="author"/>)
  63.     </xsl:if>
  64.     
  65.        </dt>
  66.     </font></strong>
  67.     <p></p>
  68.       <dd>
  69.     <font size="4">
  70.              <xsl:value-of select="description"/> 
  71.         <xsl:if test="pubDate">
  72.             (<xsl:value-of select="pubDate"/>)
  73.         </xsl:if>
  74.         
  75.         </font>
  76.        </dd>
  77.     <p></p>
  78.     </td>
  79.     </xsl:when>
  80.     <xsl:otherwise>
  81.       <td>
  82.          <strong><font size="4">
  83.                <dt>
  84.                  <a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  85.                   <xsl:value-of select="title"/>  </a>
  86.             <xsl:if test="author">
  87.             (<xsl:value-of select="author"/>)
  88.             </xsl:if>
  89.  
  90.               </dt>
  91.      </font></strong>
  92.      <p></p>
  93.            <dd>
  94.     <font size="4">
  95.                 <xsl:value-of select="description"/> 
  96.         <xsl:if test="pubDate">
  97.             (<xsl:value-of select="pubDate"/>)
  98.         </xsl:if>
  99.         
  100.         </font>
  101.            </dd>
  102.     <p></p>
  103.           </td>
  104.     </xsl:otherwise>
  105.     </xsl:choose>
  106.         
  107.     
  108.  </tr> 
  109. </xsl:for-each>
  110. </dl>
  111. </table>
  112. <p>
  113. <!--  ***************** Copyright ***************
  114. <xsl:value-of select="copyright"/>
  115.   --> 
  116.  
  117. </p>
  118. </body>
  119. </html>
  120. </xsl:template>
  121.  
  122. <xsl:template match="/rdf:RDF">
  123. <html>
  124. <head>
  125. <title><xsl:value-of select="rss09:channel/rss09:title"/><xsl:value-of select="rss:channel/rss:title"/></title>
  126. </head>
  127. <body bgcolor="#0099FF" background="background-rss.jpg" link="#33FF00" vlink="#FFFF99">
  128. <p>
  129. <strong><font size="5" face="Arial, Helvetica, sans-serif"><a><xsl:attribute name="href"><xsl:value-of select="rss:channel/rss:link"/><xsl:value-of select="rss09:channel/rss09:link"/></xsl:attribute>
  130. <xsl:value-of select="rss:channel/rss:title"/><xsl:value-of select="rss09:channel/rss09:title"/></a>
  131. <p></p>
  132. <xsl:if test="rss:image">
  133. <!--
  134.  --> 
  135.     <p><img><xsl:attribute name="src"><xsl:value-of select="rss:image/rss:url"/></xsl:attribute> </img></p>
  136.  
  137. </xsl:if>
  138.  
  139.  
  140. <xsl:value-of select="rss:channel/rss:description"/><xsl:value-of select="rss09:channel/rss09:description"/>
  141. </font></strong>
  142.  
  143. </p>
  144.  
  145. <strong>
  146. <p>
  147. <!-- Make the date presentable -->
  148. <xsl:if test="rss:channel/dc:date">
  149.     Date: 
  150.     <xsl:variable name="datetime" select="rss:channel/dc:date"/>
  151.     <xsl:variable name="day" select="substring($datetime, 9, 2)"/>
  152.     <xsl:variable name="month" select="substring($datetime, 6, 2)"/>
  153.     <xsl:variable name="year" select="substring($datetime, 0, 5)"/>
  154.     <xsl:value-of select="concat($day, '/', $month, '/', $year)"/> - 
  155.     <xsl:value-of select="substring($datetime, 12, 5)"/>
  156. </xsl:if>
  157. <xsl:if test="rss:channel/dc:publisher">
  158.     <p></p>Publisher:  <xsl:value-of select="rss:channel/dc:publisher"/>
  159.     <xsl:if test="rss:channel/dc:publisher">
  160.      Subject: <xsl:value-of select="rss:channel/dc:subject"/>
  161.     </xsl:if>
  162.  
  163. </xsl:if>
  164.  
  165. </p>
  166. </strong>
  167. <HR size="6" color="darkblue" />
  168. <table width="100%" border="1">
  169.  
  170. <dl>
  171. <xsl:for-each select="rss:item">
  172.  
  173. <tr> 
  174.     
  175.     <xsl:choose>
  176.     <xsl:when test="position() mod 2 = 1">
  177.     <td bgcolor="#3399FF">
  178.  
  179.        <strong><font size="4">
  180.  
  181.               <dt>
  182.                   <a><xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
  183.                  <xsl:value-of select="rss:title"/></a>
  184.     <xsl:if test="dc:subject">
  185.                - <xsl:value-of select="dc:subject"/> 
  186.     </xsl:if>
  187.     <xsl:if test="dc:creator">
  188.                - (Author: <xsl:value-of select="dc:creator"/>) 
  189.     </xsl:if>
  190.  
  191.              </dt>
  192.              </font></strong>
  193.            <dd>
  194.     <font size="4">
  195.  
  196.               <xsl:if test="rss:description">
  197.               <xsl:value-of select="rss:description"/> 
  198.     </xsl:if>
  199.  
  200.               <!-- Format the publish date -->
  201.     <xsl:if test="dc:date">
  202.                 (<xsl:variable name="pubdate" select="dc:date"/>
  203.                 <xsl:variable name="pubday" select="substring($pubdate, 9, 2)"/>
  204.                 <xsl:variable name="pubmonth" select="substring($pubdate, 6, 2)"/>
  205.                 <xsl:variable name="pubyear" select="substring($pubdate, 0, 5)"/>
  206.                 <xsl:value-of select="concat($pubday, '/', $pubmonth, '/', $pubyear)"/> - 
  207.                 <xsl:value-of select="substring($pubdate, 12, 5)"/>)
  208.     </xsl:if>
  209.  
  210.     </font>
  211.          </dd>
  212.        </td>
  213.       </xsl:when>
  214.       <xsl:otherwise>
  215.       <td>
  216.  
  217.     <strong><font size="4">
  218.  
  219.         <dt>
  220.             <a><xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
  221.             <xsl:value-of select="rss:title"/></a>
  222.         </dt>
  223.     </font></strong>
  224.         <dd>
  225.              <font size="4">
  226.     <xsl:if test="rss:description">
  227.               <xsl:value-of select="rss:description"/> 
  228.     </xsl:if>
  229.  
  230.             <!-- Format the publish date -->
  231.     <xsl:if test="dc:date">
  232.               (<xsl:variable name="pubdate" select="dc:date"/>
  233.               <xsl:variable name="pubday" select="substring($pubdate, 9, 2)"/>
  234.               <xsl:variable name="pubmonth" select="substring($pubdate, 6, 2)"/>
  235.               <xsl:variable name="pubyear" select="substring($pubdate, 0, 5)"/>
  236.               <xsl:value-of select="concat($pubday, '/', $pubmonth, '/', $pubyear)"/> - 
  237.               <xsl:value-of select="substring($pubdate, 12, 5)"/>)
  238.     </xsl:if>
  239.            </font>
  240.          </dd>
  241.        </td>
  242.       </xsl:otherwise>
  243.       </xsl:choose>
  244.      </tr>
  245.     </xsl:for-each>
  246.  
  247. <!--Now do it for the 0.9 type RDF feeds-->
  248.  
  249. <xsl:for-each select="rss09:item">
  250.  
  251. <tr> 
  252.     
  253.     <xsl:choose>
  254.     <xsl:when test="position() mod 2 = 1">
  255.     <td bgcolor="#3399FF">
  256.  
  257.        <strong><font size="4">
  258.  
  259.               <dt>
  260.                   <a><xsl:attribute name="href"><xsl:value-of select="rss09:link"/></xsl:attribute>
  261.                  <xsl:value-of select="rss09:title"/></a>
  262.              </dt>
  263.              </font></strong>
  264.            <dd>
  265.     <font size="4">
  266.  
  267.               <xsl:if test="rss09:description">
  268.               <xsl:value-of select="rss09:description"/> 
  269.     </xsl:if>
  270.  
  271.               <!-- Format the publish date -->
  272.     <xsl:if test="dc:date">
  273.                 (<xsl:variable name="pubdate" select="dc:date"/>
  274.                 <xsl:variable name="pubday" select="substring($pubdate, 9, 2)"/>
  275.                 <xsl:variable name="pubmonth" select="substring($pubdate, 6, 2)"/>
  276.                 <xsl:variable name="pubyear" select="substring($pubdate, 0, 5)"/>
  277.                 <xsl:value-of select="concat($pubday, '/', $pubmonth, '/', $pubyear)"/> - 
  278.                 <xsl:value-of select="substring($pubdate, 12, 5)"/>)
  279.     </xsl:if>
  280.  
  281.     </font>
  282.          </dd>
  283.        </td>
  284.       </xsl:when>
  285.       <xsl:otherwise>
  286.       <td>
  287.  
  288.     <strong><font size="4">
  289.  
  290.         <dt>
  291.             <a><xsl:attribute name="href"><xsl:value-of select="rss09:link"/></xsl:attribute>
  292.             <xsl:value-of select="rss09:title"/></a>
  293.         </dt>
  294.     </font></strong>
  295.         <dd>
  296.              <font size="4">
  297.     <xsl:if test="rss09:description">
  298.               <xsl:value-of select="rss09:description"/> 
  299.     </xsl:if>
  300.  
  301.             <!-- Format the publish date -->
  302.     <xsl:if test="dc:date">
  303.               (<xsl:variable name="pubdate" select="dc:date"/>
  304.               <xsl:variable name="pubday" select="substring($pubdate, 9, 2)"/>
  305.               <xsl:variable name="pubmonth" select="substring($pubdate, 6, 2)"/>
  306.               <xsl:variable name="pubyear" select="substring($pubdate, 0, 5)"/>
  307.               <xsl:value-of select="concat($pubday, '/', $pubmonth, '/', $pubyear)"/> - 
  308.               <xsl:value-of select="substring($pubdate, 12, 5)"/>)
  309.     </xsl:if>
  310.            </font>
  311.          </dd>
  312.        </td>
  313.       </xsl:otherwise>
  314.       </xsl:choose>
  315.      </tr>
  316.     </xsl:for-each>
  317.  
  318.  
  319. </dl>
  320. </table>
  321.  
  322. </body>
  323. </html>
  324.  
  325. </xsl:template>
  326.  
  327. </xsl:stylesheet>
  328.